package com.wxc.api.admin.entity;

import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.*;
import javax.validation.groups.Default;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author baomidou
 * @since 2022-04-14
 */
@TableName("sys_user")
@ApiModel(value = "SysUser对象", description = "用户表")
@Data
public class SysUser implements Serializable {

    public interface EditGroup extends Default{
    }

    public interface AddGroup extends Default {
    }

    public interface DelGroup extends Default {
    }


    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Min(value = 1, message = "id必须为正整数",groups = DelGroup.class)
    private Integer id;

    @ApiModelProperty("账号")
    @NotBlank(message = "账号不能为空",groups = AddGroup.class)
    private String account;

    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空",groups = AddGroup.class)
    private String userName;

    @ApiModelProperty("用户密码")
    @NotBlank(message = "用户密码不能为空",groups = AddGroup.class)
    @Length(min = 6,max = 20,message = "用户密码长度在6-20之间")
    private String password;

    @ApiModelProperty("上一次登录时间")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty("账号是否可用。默认为1（可用）")
    private Boolean enabled;

    @ApiModelProperty("是否过期。默认为1（没有过期）")
    private Boolean accountNotExpired;

    @ApiModelProperty("账号是否锁定。默认为1（没有锁定）")
    private Boolean accountNotLocked;

    @ApiModelProperty("证书（密码）是否过期。默认为1（没有过期）")
    private Boolean credentialsNotExpired;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    private Integer deleted;

    @ApiModelProperty("创建人")
    private Integer createUser;

    @ApiModelProperty("修改人")
    private Integer updateUser;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public LocalDateTime getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(LocalDateTime lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
    public Boolean getAccountNotExpired() {
        return accountNotExpired;
    }

    public void setAccountNotExpired(Boolean accountNotExpired) {
        this.accountNotExpired = accountNotExpired;
    }
    public Boolean getAccountNotLocked() {
        return accountNotLocked;
    }

    public void setAccountNotLocked(Boolean accountNotLocked) {
        this.accountNotLocked = accountNotLocked;
    }
    public Boolean getCredentialsNotExpired() {
        return credentialsNotExpired;
    }

    public void setCredentialsNotExpired(Boolean credentialsNotExpired) {
        this.credentialsNotExpired = credentialsNotExpired;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Integer createUser) {
        this.createUser = createUser;
    }
    public Integer getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(Integer updateUser) {
        this.updateUser = updateUser;
    }

    @Override
    public String toString() {
        return "SysUser{" +
            "id=" + id +
            ", account=" + account +
            ", userName=" + userName +
            ", password=" + password +
            ", lastLoginTime=" + lastLoginTime +
            ", enabled=" + enabled +
            ", accountNotExpired=" + accountNotExpired +
            ", accountNotLocked=" + accountNotLocked +
            ", credentialsNotExpired=" + credentialsNotExpired +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", createUser=" + createUser +
            ", updateUser=" + updateUser +
        "}";
    }
}
